package com.vst.serverdatalib.entity;

import org.json.JSONObject;

import com.vst.serverdatalib.https.HttpHelper;

public class UrlRequestEntity {

    private String mCookie;

    private int mQuestMethod = HttpHelper.GET;

    private String mReferer;

    private String mUserAgent;

    private String mUrl;

    public UrlRequestEntity() {

    }

    public UrlRequestEntity(JSONObject jsonObject) {
        if (jsonObject == null || !jsonObject.has("url")) {
            return;
        }
        mCookie = jsonObject.optString("cookie");
        mReferer = jsonObject.optString("referer");
        mUrl = jsonObject.optString("url");
        mUserAgent = jsonObject.optString("user_agent");
        String requestMethod = jsonObject.optString("requestMethod");
        if (requestMethod.equals("post")) {
            mQuestMethod = HttpHelper.POST;
        }
    }

    public String getCookie() {
        return mCookie;
    }

    public int getQuestMethod() {
        return mQuestMethod;
    }

    public String getReferer() {
        return mReferer;
    }

    public String getUserAgent() {
        return mUserAgent;
    }

    public String getUrl() {
        return mUrl;
    }

}
